package com.bjc.chapter16.reference;

/**
 * @program: jvm_demo
 * @description: 强引用
 * @author: bjc
 * @create: 2022-02-17 21:49
 */
public class StrongReferenceTest {

    public static void main(String[] args) {
        StringBuffer str = new StringBuffer("Hello,CN");
        StringBuffer str1 = str;

        str = null;
        System.gc();

        try {
            Thread.sleep(3000);
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(str1);
    }
}
